package com.zkthink.ceres.product.service.impl;

import com.zkthink.database.mybatis.conditions.Wraps;
import com.zkthink.ceres.product.dao.LogisticsDetailMapper;
import com.zkthink.ceres.product.entity.LogisticsDetail;
import com.zkthink.ceres.product.service.LogisticsDetailService;
import com.zkthink.base.service.SuperServiceImpl;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 业务实现类
 * 物流方案明细
 * </p>
 *
 * @author vivi.huang
 * @date 2020-05-16
 */
@Slf4j
@Service
@AllArgsConstructor
public class LogisticsDetailServiceImpl extends SuperServiceImpl<LogisticsDetailMapper, LogisticsDetail> implements LogisticsDetailService {


    private LogisticsDetailMapper logisticsDetailMapper;

    @Override
    public List<LogisticsDetail> findLogisticsDetailList(List<Long> logisticsId) {
        return this.list(Wraps.<LogisticsDetail>lbQ()
                .in(LogisticsDetail::getLogisticsId, logisticsId));
    }

    @Override
    public void removeByLogisticsId(Long id) {
        this.remove(Wraps.<LogisticsDetail>lbQ().eq(LogisticsDetail::getLogisticsId, id));
    }

    @Override
    public List<LogisticsDetail> findLogisticsDetailList(String tenantCode) {
        return logisticsDetailMapper.findLogisticsDetailList(tenantCode);
    }
}
